import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import Components from "unplugin-vue-components/vite";
import AutoImport from "unplugin-auto-import/vite";
import { resolve } from "path";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
    AutoImport({
      dts: true,
      imports: ["vue"],
    }),
    Components({
      dirs: ["src/components"],
      extensions: ["vue"],
      dts: true,
    }),
  ],
  resolve: {
    alias: {
      "@": resolve(__dirname, "./src"),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        charset: false,
        javascriptEnabled: true,
        additionalData: '@import "@/static/scss/global.scss";'
      },
    },
  },
});
